home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12163 < prev    next >
Encoding:
Text File  |  1996-08-05  |  978 b   |  44 lines

  1. Path: nntphub.cb.att.com!news
  2. From: "Andrew M. Shaw" <shaw@lydian.lc.att.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: MS VC++ 4.0 namespace weirdness
  5. Date: Mon, 18 Mar 1996 12:32:54 -0500
  6. Organization: Lucent Technologies Bell Labs
  7. Message-ID: <314D9E46.433@lydian.lc.att.com>
  8. NNTP-Posting-Host: andrew.lc.att.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (WinNT; I)
  13.  
  14. [Hope this is the right group -- didn't see a VC++-specific one]
  15.  
  16. If I define a namespace in an include file, the classes within 
  17. that
  18. namespace are not recognized by the MS VC++ 4.0 class window.  
  19. If I
  20. define the namespace in the including file, they are.  Any 
  21. opinions
  22. on this anomaly?
  23.  
  24.     Thanks,
  25.         andrew.shaw@att.com
  26.  
  27. Example:
  28.  
  29. // foo1.hpp
  30. namespace FOO1
  31. {
  32. class X1 { int x1; };
  33. }
  34.  
  35. // foo2.hpp
  36. class X2 { int x2; };
  37.  
  38. // foo.cpp
  39. #include "foo1.hpp"    // whereis FOO1::X1?
  40. namespace FOO2
  41. {
  42. #include "foo2.hpp"    // FOO2::X2 no problem
  43. }
  44.